package trogiup;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;

import trangchu.UtilDelegate;

public class DSJGetLienHe {
	private String id;	
	private String tenCongTy;
	private String diachi;
	private String dienthoai;
	private String fax;
	private String email;
	private String web;
	private String linhvuc;
	private String nganhnghe;
	private String masothue;
	private String nguoilienhe;
	private String noidung;
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getTenCongTy() {
		return tenCongTy;
	}
	public String getDienthoai() {
		return dienthoai;
	}
	public void setDienthoai(String dienthoai) {
		this.dienthoai = dienthoai;
	}
	public String getFax() {
		return fax;
	}
	public void setFax(String fax) {
		this.fax = fax;
	}
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	public String getWeb() {
		return web;
	}
	public void setWeb(String web) {
		this.web = web;
	}
	public String getLinhvuc() {
		return linhvuc;
	}
	public void setLinhvuc(String linhvuc) {
		this.linhvuc = linhvuc;
	}
	public String getNganhnghe() {
		return nganhnghe;
	}
	public void setNganhnghe(String nganhnghe) {
		this.nganhnghe = nganhnghe;
	}
	public String getMasothue() {
		return masothue;
	}
	public void setMasothue(String masothue) {
		this.masothue = masothue;
	}
	public String getNguoilienhe() {
		return nguoilienhe;
	}
	public void setNguoilienhe(String nguoilienhe) {
		this.nguoilienhe = nguoilienhe;
	}
	public String getNoidung() {
		return noidung;
	}
	public void setNoidung(String noidung) {
		this.noidung = noidung;
	}
	public void setTenCongTy(String tenCongTy) {
		this.tenCongTy = tenCongTy;
	}
	public String getDiachi() {
		return diachi;
	}
	public void setDiachi(String diachi) {
		this.diachi = diachi;
	}
	public void edit(){
		Connection con =UtilDelegate.getConnection();		
		PreparedStatement st;
		try {
			
			st = con.prepareStatement("UPDATE LienHe SET TenCongTy=?,DiaChi=?,DienThoai=?,Fax=?,Email=?,Website=?,LinhVuc=?,NganhNghe=?,MaSoThue=?,NguoiLienHe=?,NoiDung=? WHERE id=1");	
			st.setString(1, this.tenCongTy);
			st.setString(2, this.diachi);
			st.setString(3, this.dienthoai);
			st.setString(4, this.fax);
			st.setString(5, this.email);
			st.setString(6, this.web);
			st.setString(7, this.linhvuc);
			st.setString(8, this.nganhnghe);
			st.setString(9, this.masothue);
			st.setString(10, this.nguoilienhe);
			st.setString(11, this.noidung);
			
			st.executeUpdate();			
		} catch (SQLException e) {
			e.printStackTrace();
		}
		
	}

}
